package org.brunoc.searchstores4j.vo.models;

import java.io.IOException;
import java.util.List;

import org.apache.commons.httpclient.HttpException;
import org.brunoc.searchstores4j.SupportedStores;

/**
 * Abstract class that defines the default template of a Store Object.
 * 
 * @author Bruno Candido Volpato da Cunha
 *
 */
public abstract class IStoreObject {
	
	public String name;
	
	public String searchUrl;
	
	public SupportedStores store;
	
	public String makeUrl(String query) {
		return makeUrl(query, 0);
	}

	
	public List<Product> makeAndSearch(String query) throws HttpException, IOException {
		return search(makeUrl(query));
	}

	public abstract String makeUrl(String query, int offset);

	public abstract List<Product> search(String url) throws HttpException, IOException;


	public String getName() {
		return this.name;
	}
	
	public String getSearchUrl() {
		return searchUrl;
	}


	public void setSearchUrl(String searchUrl) {
		this.searchUrl = searchUrl;
	}


	public SupportedStores getStore() {
		return store;
	}


	public void setStore(SupportedStores store) {
		this.store = store;
	}


	
}
